package com.gotop.common.utils;

import java.util.UUID;

/**
 * @program: cem
 * @description:
 * @author: superfish
 * @create: 2021-01-04 15:36
 **/
public class ClientGenerateUtil {
    public static String getUUID(int num) {
        String uuid = UUID.randomUUID().toString();
        if (16 == num) {
            char[] cs = new char[32];
            char c = 0;
            for (int i = uuid.length() / 2, j = 1; i-- > 0; ) {
                if ((c = uuid.charAt(i)) != '-') {
                    cs[j++] = c;
                }
            }
            String uid = String.valueOf(cs);
            return "cem" + uid;
        } else {
            return uuid.replace("-", "");
        }
    }
}
